Retrieve the unique integer value assigned to the item.
Parent Type: LearningStoreItemIdentifier
Namespace: Microsoft.LearningComponents.Storage
Assembly: Microsoft.LearningComponents.Storage.dll
| C# |
|
public long GetKey () |
| Exception type | Condition |
| System.InvalidOperationException | A unique integer value is not available. |
Note that this value only uniquely identifies an item within a particular item type. Two items with two different ItemTypeNames may return the same value from GetKey.
A unique integer value is not always available. In particular, a unique integer value is not available from LearningStoreItemIdentifiers returned from LearningStoreJob.AddItem. Identifiers returned from that method have not yet been added to the store, and therefore do not yet have a unique integer value.
The following code creates a LearningStoreItemIdentifier and then retrieves the unique integer value:
| C# |
LearningStoreItemIdentifier id = new LearningStoreItemIdentifier("UserItem", 50);
long key = id.GetKey();
|